
package com.work.util;

import java.util.Locale;

import com.vaadin.data.util.converter.Converter;

public class StringConverter implements Converter<String, String> {

	private static final long serialVersionUID = 3410252445575655118L;

	@Override
	public Class<String> getModelType()
	{
		return String.class;
	}

	@Override
	public Class<String> getPresentationType()
	{
		return String.class;
	}

	@Override
	public String convertToModel(String value, Locale locale) throws com.vaadin.data.util.converter.Converter.ConversionException
	{
		return value;
	}

	@Override
	public String convertToPresentation(String value, Locale locale) throws com.vaadin.data.util.converter.Converter.ConversionException
	{
		if (value != null) {
			return value.toString();
		}
		
		return "";
	}
}